package SyncPool;

import java.io.Serializable;
import java.util.concurrent.Callable;

import manager.ConnectionManager;

import connection.HttpRequest;

public class CallBack implements Callable ,Serializable{
	private URLConfig config;
	private HttpRequest http;
	private ConnectionManager requstManager;
	
	
	public CallBack(URLConfig config,HttpLifeCycleInterface httpLifeCycleInterface) {
		this.config = config;
		http=new HttpRequest(httpLifeCycleInterface);
		requstManager=new ConnectionManager(config,http);
		
		
	}
	
	public ConnectionManager getRequstManager() {
		return requstManager;
	}

	@Override
	public Object call() throws Exception {
		// TODO Auto-generated method stub
		switch (config.getRequestType()) {
		case RequestType.POST:
			 requstManager.SendPost();
			break;
		case RequestType.GET:
			 requstManager.SendPost();
			break;

		default:
			break;
		}

		return null;
	}

	
	
	
	
}
